﻿(function () {
    var autoUploadImageFieldContext = {};

    // You can provide templates for:
    // View, DisplayForm, EditForm and NewForm
    autoUploadImageFieldContext.Templates = {};
    autoUploadImageFieldContext.Templates.Fields = {
        "AutoUploadImageField": {
            //  "View": favoriteColorViewTemplate
            "NewForm": AutoUploadImageFieldNew,
            "EditForm": AutoUploadImageFieldEdit,
            "DisplayForm": AutoUploadImageFieldDispaly
        }
    };

    SPClientTemplates.TemplateManager.RegisterTemplateOverrides(
        autoUploadImageFieldContext
        );
})();

// The favoriteColorViewTemplate provides the rendering logic
// the custom field type when it is displayed in the view form.
function favoriteColorViewTemplate(ctx) {
    var color = ctx.CurrentItem[ctx.CurrentFieldSchema.Name];
    return "<span style='background-color : " + color +
        "' >&nbsp;&nbsp;&nbsp;&nbsp;</span>&nbsp;" + color;
}

function AutoUploadImageFieldNew(renderCtx, field, listItem, listSchema)
{

}

function AutoUploadImageFieldEdit(renderCtx, field, listItem, listSchema) {

}

function AutoUploadImageFieldDispaly(renderCtx, field, listItem, listSchema) {

}